using System.Windows.Forms;
using K9MPro.Business;

namespace K9MPro.UserInterface
{
    public partial class frmMain : Form
    {
        private frmFloatingDashboard frmFDB;

        public frmMain()
        {
            InitializeComponent();
        }

        private void frmMain_Load(object sender, System.EventArgs e)
        {
            // load the floating dashboard
            frmFDB = new frmFloatingDashboard();
            frmFDB.MdiParent = this;
            frmFDB.StartPosition = FormStartPosition.CenterScreen;
            frmFDB.Show();

            // load the login screen
            frmLogin login = new frmLogin();
            login.ShowDialog(this);
        }

        private void openTestFormToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            Test myTestForm = new Test();
            myTestForm.Show();
        }

        private void frmMain_Resize(object sender, System.EventArgs e)
        {
            if (frmFDB != null)
            {
                frmFDB.Left = (this.Width / 2) - (frmFDB.Width / 2) - 10;
                frmFDB.Top = (this.Height / 2) - (frmFDB.Height / 2) - 50;
            }
        }
    }
}